/*
 * @Author: your name
 * @Date: 2021-08-31 17:30:02
 * @LastEditTime: 2021-08-31 19:19:43
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day07\6-重写.js
 */

//重写every   每一个都    全部要满足条件，一个不满足则为false，
Array.prototype.myEvery = function(foo) {
        //循环遍历数组下标
        for (i = 0; i < this.length; i++) {
            //如果传过来数组值不满足要查询的条件
            if (!foo(this[i])) {
                return false;
            }
        }
        return true;
    }
    //定义一个数组
var arr = [100, 80, 20, 200, 150];
//要查询的条件
function big(value, index, arr) {
    return value > 30;
}
//函数调用执行
var sub = arr.myEvery(big);
console.log(sub);